﻿@{
    Layout = "_ConfigurePlugin";
}

@model ConfigurationModel

@using Nop.Plugin.Payments.CashOnDelivery.Models;
@using Nop.Web.Framework.Extensions

@await Component.InvokeAsync("StoreScopeConfiguration")

<form asp-controller="PaymentCashOnDelivery" asp-action="Configure" method="post">
    <div class="panel-group">
        <div class="panel panel-default">
            <div class="panel-body">
                @(Html.LocalizedEditor<ConfigurationModel, ConfigurationModel.ConfigurationLocalizedModel>("plugin-settings-localized",
                @<div class="form-group">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="DescriptionText_OverrideForStore" asp-input="Locales[item].DescriptionText" asp-store-scope="Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="Locales[item].DescriptionText" />
                    </div>
                    <div class="col-md-9">
                        <nop-textarea asp-for="Locales[item].DescriptionText"/>
                        <span asp-validation-for="Locales[item].DescriptionText"></span>
                        @Html.HiddenFor(model => model.Locales[item].LanguageId)
                    </div>
                </div>,
                @<div class="form-group">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="DescriptionText_OverrideForStore" asp-input="DescriptionText" asp-store-scope="Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="DescriptionText" />
                    </div>
                    <div class="col-md-9">
                        <nop-textarea asp-for="DescriptionText" />
                        <span asp-validation-for="DescriptionText"></span>
                    </div>
                </div>,
                //localizable settings per store (overrriden store settings) are not supported yet
                true))
                <div class="form-group">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="AdditionalFee_OverrideForStore" asp-input="AdditionalFee" asp-store-scope="Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="AdditionalFee" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="AdditionalFee" />
                        <span asp-validation-for="AdditionalFee"></span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="AdditionalFeePercentage_OverrideForStore" asp-input="AdditionalFeePercentage" asp-store-scope="Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="AdditionalFeePercentage" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="AdditionalFeePercentage" />
                        <span asp-validation-for="AdditionalFeePercentage"></span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-3">
                        <nop-override-store-checkbox asp-for="ShippableProductRequired_OverrideForStore" asp-input="ShippableProductRequired" asp-store-scope="Model.ActiveStoreScopeConfiguration" />
                        <nop-label asp-for="ShippableProductRequired" />
                    </div>
                    <div class="col-md-9">
                        <nop-editor asp-for="ShippableProductRequired" />
                        <span asp-validation-for="ShippableProductRequired"></span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-9 col-md-offset-3">
                        <input type="submit" name="save" class="btn bg-blue" value="@T("Admin.Common.Save")" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
